VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "COMlib"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

'===============================================================================
' Name: Function GetActiveCATVBAPath
' Input:
' Output:
'    String - Current vba path
' Purpose: Obtenir le chemin du fichier vba courant
' Remarks: In Tools > References > Add Microsoft APC 6.2 Object Library
'===============================================================================
Function GetActiveCATVBAPath() As String
    Dim APC_Obj
    Set APC_Obj = CreateObject("MSAPC.Apc")
    GetActiveCATVBAPath = APC_Obj.VBE.ActiveVBProject.FileName
End Function

'===============================================================================
' Name: Function GetActiveCATVBAFolderPath
' Input:
' Output:
'    String - Current vba folder path
' Purpose: Obtenir le chemin du dossier du vba courant
' Remarks: In Tools > References > Add Microsoft APC 6.2 Object Library
'===============================================================================
Function GetActiveCATVBAFolderPath() As String
    Dim APC_Obj
    Set APC_Obj = CreateObject("MSAPC.Apc")
    GetActiveCATVBAFolderPath = Left(APC_Obj.VBE.ActiveVBProject.FileName, Len(APC_Obj.VBE.ActiveVBProject.FileName) - Len("\" & APC_Obj.VBE.ActiveVBProject.Name & ".catvba"))
End Function


